
/*
 * @Description:Circle
 * 
 * @Author: rendc
 * 
 * @Date: 2025-08-05 11:09:30
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-08-05 11:24:08
 */
import static java.lang.Math.PI;

public class Circle extends Shape {
  // 私有属性 半径
  private double r;

  // 构造器
  public Circle() {
  }

  public Circle(String name, double r) {
    super(name);
    this.r = r;
  }

  public Circle(String name, int r) {
    super(name);
    this.r = r * 2;
  }

  // 重写父类的抽象方法
  @Override
  public double getArea() {
    return PI * r * r;
  }

}